﻿namespace net.zxteam.ZXLexer.Rules.Internal
{
	using net.zxteam.ZXLexer.Tokens;
	using System.Diagnostics.Contracts;

	internal sealed class CharRule : InnerRule, ICharRule
	{
		private readonly char _value;

		internal CharRule(IRule parentRule, char value)
			: base(parentRule)
		{
			_value = value;
		}

		public override IToken Accept(IRuleVisitor visitor)
		{
			Contract.Requires(visitor != null);

			return visitor.VisitCharRule(this);
		}

		public char Value { get { return _value; } }
	}
}
